﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Medianamik.UI.ImportExportManagement
{
    public class RecordProperty
    {
        public RecordProperty(RecordTypeProperty recordTypeProperty, String value, String cultureName)
        {
            if (recordTypeProperty == null)
                throw new ArgumentNullException("recordTypeProperty");

            if (String.IsNullOrEmpty(cultureName))
                throw new ArgumentException("cultureName");

            _recordTypeProperty = recordTypeProperty;
            _cultureName = cultureName;
            Value = value;
        }

        public RecordProperty(RecordTypeProperty recordTypeProperty, String value,
            String cultureName, Guid id)
            : this(recordTypeProperty, value, cultureName)
        {
            Id = id;
        }

        public Guid? Id { get; set; }

        public String Value { get; set; }

        public String CultureName
        {
            get { return _cultureName; }
            set
            {
                if (String.IsNullOrEmpty(value))
                    throw new ArgumentException("CultureName");

                _cultureName = value;
            }
        }
        string _cultureName;

        public RecordTypeProperty RecordTypeProperty
        {
            get
            {
                return _recordTypeProperty;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("RecordTypeProperty");
                _recordTypeProperty = value;
            }
        }
        RecordTypeProperty _recordTypeProperty;
    }
}
